#爬取糗事百科热门段子
import requests
from bs4 import BeautifulSoup
import time

count = 1
for i in range(10):
    count += i 
    time.sleep(3) #实现每3秒打印一页
    url = r"https://www.qiushibaike.com/8hr/page/"+str(count)+r"/?s=4999461"
    r = requests.get(url)
    html = r.text
    soup = BeautifulSoup(html,'html.parser')
    for txt in soup.findAll('span',{'class':None})[:-5]:
        print(txt.get_text()+'\n')
